package com.hx.petsever.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hx.petsever.entity.Info;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;


@Mapper
public interface InfoMapper extends BaseMapper<Info> {

    @Select("SELECT * FROM user_info WHERE userid = #{userid}")
    Info getInfo(@Param("userid") String userid);

    @Update("UPDATE user_info SET  userid = #{userid} , sex = #{sex} , age = #{age} , habit = #{habit} WHERE userid = #{userid}")
    void updateInfo(@Param("userid") String userid ,@Param("sex") String sex , @Param("age") String age , @Param("habit") String habit);
}
